package top.hg.tool.modules.joke;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.Method;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: skh
 * @Date: 2019/7/12 14:14
 * @Description:
 */
@RestController
public class JokeController {

    @Autowired
    private JokeService jokeService;

    @GetMapping("/joke/list")
    public String getJokeList() {
        jokeService.getJokeList();

        return "success";
    }

    @GetMapping("/video/list")
    public String getVideoList() {
//        jokeService.getVideoList();

        return "success";
    }


    public static void main(String[] args) {
        HttpRequest request = new HttpRequest("https://qbb.qiushibaike.com/r?os=iOS&v=0.4&appid=ios-qiushibaike");
        request= request.header("qbaid", "B7810816-9E94-4A21-AA4C-6386438E93CF").contentType("application/json").method(Method.POST);
        String body = request.execute().body();
        System.out.println("body = " + body);
    }

}
